from typing import Any


class GeneralErr(Exception):
    def __init__(self, 
            code: int = -1,
            msg: str = None, 
            data: Any = "",
            status_code: int = 400):
        Exception.__init__(self)
        self.code = code
        self.msg = msg
        self.data = data
        self.status_code = status_code
        
    @property
    def payload(self):
        return {
            "code": self.code,
            "msg": self.msg,
            "data": self.data
        }


UNKNOWN_ERROR = GeneralErr(msg = "Unknown Error")